import bot from "../model/bot/amesu";
import browser, { tempDir } from "../model/browser/browser";
import func from "../model/func";
import { MsgAction, Tpl_panel_job } from "../shared/master/MsgAction";

export default function (data: MsgAction) {
    let d = data.data as Tpl_panel_job;
    func.roundNumbers(d,0)
    browser.render(tempDir.血统模板, {
        a: d.points.a,
        b: d.points.b,
        c: d.points.c,
        d: d.points.d,
        name: `${d.type}·${func.numberToChinese(d.leve.num)}阶`,
        style_body: d.style_id,
        style_title: d.title_style,
        expBar:`${Math.ceil((d.leve.max / d.leve.now)*100)}%`,
        needExp: func.BN(d.leve.max - d.leve.now)
    }).then((png) => {
        bot.sendLocaImage(data.tolocation, png);
    });
}